<?php
require "Smarty.class.php";

function smarty_init()
{
	$smarty = new Smarty();

	$smarty->template_dir = "modules";

	$smarty->assign("module", get_module());
	$smarty->assign("action", get_action());

	return $smarty;
}

function smarty_run($smarty)
{
	require "modules/" . get_module() . "/actions/" . get_action() . ".php";

	$smarty->assign("errors", $errors);
	$smarty->assign("alerts", $alerts);

	$smarty->display("base.tpl");
}

function smarty_register_function($smarty, $name)
{
	$smarty->register_function($name, $name);
}
?>
